import { createStore } from 'vuex';  
import { getCookie, get__token } from '@/utils/getPageDecrypt';  
  
export interface JinritemaiDecryptState {  
    msToken: string;  
    __token: string;  
    userInfo: object;  
}  
  
const store = createStore<JinritemaiDecryptState>({  
    state: {  
        msToken: '',  
        __token: '',  
        userInfo: {},  
    },  
    mutations: {  
        SET_TOKEN(state) {  
            state.msToken = getCookie('msToken');  
            const getuserinfo = get__token();  
            state.__token = getuserinfo.__token;  
            state.userInfo = getuserinfo.userInfo;  
        },  
    },  
    actions: {  
        async fetchAndSetToken({ commit }) {  
            // 你可以在这里添加异步逻辑，比如 API 调用  
            commit('SET_TOKEN');  
        },  
    },  
    getters: {  
        // 定义 getters  
    },  
});  
  
export default store;